library(dplyr)
library(ggplot2)
library(readr)
library(plotly)
library(DT)
library(readxl)
censo_etnia <-
  read_excel("C:/Users/erick.ruiz/Documents/R c/repoblaccenso2011-04.xlsx",
             n_max = Inf
              )
censo_etnia %>%
  datatable(options = list(
    pageLength = 5,
    language = list(url = '//cdn.datatables.net/plug-ins/1.10.11/i18n/Spanish.json')
  ))
grafico_censo_etnia <-
  censo_etnia %>%
  count(`Cuadro 4`) %>% 
  ggplot(aes(x = reorder(`Cuadro 4`, n), y = n)) +
  geom_bar(stat = "identity") +
  xlab("Especie") +
  ylab("Registros de presencia") +
  coord_flip() 
 



  ggplotly(grafico_censo_etnia) %>% 
  config(locale = 'es')